package cn.stylefeng.guns.modular.business.mapper;

import cn.stylefeng.guns.modular.business.entity.Card;
import cn.stylefeng.guns.modular.business.model.dto.KeyValueDTO;
import cn.stylefeng.guns.modular.business.model.params.CardParam;
import cn.stylefeng.guns.modular.business.model.result.CardResult;
import cn.stylefeng.guns.modular.business.model.result.UserPropertyResult;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 卡号 Mapper 接口
 * </p>
 *
 * @author jwj
 * @since 2019-07-12
 */
public interface CardMapper extends BaseMapper<Card> {

    /**
     * 获取列表
     *
     * @author jwj
     * @Date 2019-07-12
     */
    List<CardResult> customList(@Param("paramCondition") CardParam paramCondition);

    /**
     * 获取map列表
     *
     * @author jwj
     * @Date 2019-07-12
     */
    List<Map<String, Object>> customMapList(@Param("paramCondition") CardParam paramCondition);

    /**
     * 获取分页实体列表
     *
     * @author jwj
     * @Date 2019-07-12
     */
    Page<CardResult> customPageList(@Param("page") Page page, @Param("paramCondition") CardParam paramCondition);

    /**
     * 获取分页map列表
     *
     * @author jwj
     * @Date 2019-07-12
     */
    Page<Map<String, Object>> customPageMapList(@Param("page") Page page, @Param("paramCondition") CardParam paramCondition);

    /**
     * 获取用户总面值
     *
     * @param userId 用户id
     * @return
     */
    Integer totalQuota(@Param("userId")Long userId);

    /**
     * 获取所有用户总面值
     *
     * @return
     */
    UserPropertyResult allUserQuota(Long userId);

}
